#ifndef GLScene_H
#define GLScene_H

#include <QGLWidget>
#include <QtOpenGL>
#include "point3d.h"
#include "planet_math.h"
#include "scene.h"
 
class GLScene : public QGLWidget
{
private:
  GLfloat xRot;
  GLfloat yRot;
  GLfloat zRot;
  GLfloat zTra;
  GLfloat nSca;

  QPoint ptrMousePosition;
  QTimer* timer;

  void scale_plus();
  void scale_minus();
  void rotate_up();
  void rotate_down();
  void rotate_left();
  void rotate_right();
  void translate_down();
  void translate_up();
  void getVerTexArrays();
  void getIndexArray();
  void drawPlanetNew();
  void genTextures();
  void drawPoint(Point3D point);
  void drawTrajectory(QList <Point3D> point_list);
  void drawModel(QList<PlanetMath> model);

  void drawAxis();
  void drawPlanet(GLdouble radius, GLint x, GLint y, GLint z, Qt::GlobalColor color);

protected:
  void initializeGL();
  void resizeGL(int nWidth, int nHeight);
  void paintGL();
  void mousePressEvent(QMouseEvent* pe);
  void mouseMoveEvent(QMouseEvent* pe);
  void mouseReleaseEvent(QMouseEvent* pe);
  void wheelEvent(QWheelEvent* pe);
  void keyPressEvent(QKeyEvent* pe);


public:
  GLScene(QWidget* parent = 0);
  ~GLScene();

  Scene* myScene;
  void defaultScene();



private slots: 
  void change(); 
  void stopTmr(); 
  void startTmr();
};
#endif
